package com.pocket.demo.core.context;

/**
 * Ip 上下文
 * @author cookie.
 **/
public class IpContext {

    private static InheritableThreadLocal<String> ipInheritableThreadLocal = new InheritableThreadLocal<>();

    public static String getIp() {
        return ipInheritableThreadLocal.get();
    }

    public static void setIp(String ip) {
        ipInheritableThreadLocal.set(ip);
    }

    public static void remove() {
        ipInheritableThreadLocal.remove();
    }
}
